package com.hknc.btscale.utils.network;

import com.arialyy.annotations.Upload;
import com.hknc.btscale.bean.BackToServer;
import com.hknc.btscale.bean.GoodsBackToServer;
import com.hknc.btscale.bean.LoginPost;
import com.hknc.btscale.bean.LoginResponse;
import com.hknc.btscale.bean.NormalResponse;
import com.hknc.btscale.bean.OffLineData;
import com.hknc.btscale.bean.OffLineList;
import com.hknc.btscale.bean.OrderResult;
import com.hknc.btscale.bean.PlayRulesBackToServer;
import com.hknc.btscale.bean.SaveOrderBean;
import com.hknc.btscale.bean.TestBean;
import com.hknc.btscale.bean.TestBean1;
import com.hknc.btscale.bean.UploadStatus;
import com.hknc.btscale.bean.VersionApkBean;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Query;

public class ApiWrapper extends RetrofitHttpUtils {
    private static volatile ApiWrapper apiWrapper;

    private ApiWrapper() {
        init();
    }

    public static ApiWrapper getInstance() {
        if (apiWrapper == null) {
            synchronized (ApiWrapper.class) {
                if (apiWrapper == null) {
                    apiWrapper = new ApiWrapper();
                }
            }
        }
        return apiWrapper;
    }

    public Observable<LoginResponse> login(LoginPost loginPost) {
        return getApiServer().login(loginPost);
    }

    public Observable<NormalResponse> backToServer(BackToServer backToServer) {
        return getApiServer().backToServer(backToServer);
    }

    public Observable<OrderResult> addOrder(SaveOrderBean saveOrderBean) {
        return getApiServer().addOrder(saveOrderBean);
    }

    public Observable<NormalResponse> addOffLineOrder(List<OffLineData> offLineList) {
        return getApiServer().addOffLineOrder(offLineList);
    }

    public Observable<VersionApkBean> apkVersion(String marketId) {
        return getApiServer().apkVersion(marketId);
    }

    public Observable<NormalResponse> parametersAndIsLock(UploadStatus uploadStatus) {
        return getApiServer().parametersAndIsLock(uploadStatus);
    }
}